<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="../include/tag.jsp" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>退款计划列表</title>
    <%@include file="../include/commonFile.jsp" %>
    <link rel="stylesheet" href="${ctx}/css/common/list.css">
    <link rel="stylesheet" href="${ctx}/css/common/table.css">
</head>
<body>
<!--头部-->
<%@include file="../include/header.jsp" %>
<div class="index-outside">
    <%@include file="../include/sidebar.jsp" %>
    <!--内容-->
    <section>
        <div class="section-main">
            <form class="layui-form" action="${ctx}/refund/list.do" id="myForm" method="post">
                <input type="hidden" name="pageNo" id="pageNo"/>
                <div class="f-search-bar">
                    <div class="search-container">

                        <ul class="search-form-content">
                            <li class="form-item-inline"><label class="search-form-lable">合作商</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="partners" autocomplete="off" class="layui-input"
                                           value="${refundPlan.partners}" placeholder="请输入合作商名称">
                                </div>
                            </li>
                            <li class="form-item-inline"><label class="search-form-lable">项目名称</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="name" autocomplete="off" class="layui-input"
                                           value="${refundPlan.name}" placeholder="请输入项目名称">
                                </div>
                            </li>
                            <li class="form-item"><label class="search-form-lable">提交时间</label>
                                <div class="check-btn-inner" id="timeType">
                                    <a id="all" href="javascript:void(0);"
                                       onclick="setTimeType($(this),0,'#myForm')" ${empty input.timeType || input.timeType == 0 ? 'class="active"' : ''}>全部</a>
                                    <a href="javascript:void(0);"
                                       onclick="setTimeType($(this),1,'#myForm')" ${input.timeType == 1 ? 'class="active"' : ''}>今天</a>
                                    <a href="javascript:void(0);"
                                       onclick="setTimeType($(this),2,'#myForm')" ${input.timeType == 2 ? 'class="active"' : ''}>本周内</a>
                                    <a href="javascript:void(0);"
                                       onclick="setTimeType($(this),3,'#myForm')" ${input.timeType == 3 ? 'class="active"' : ''}>本月内</a>
                                    <input type="hidden" name="timeType" value="${input.timeType}"/>
                                </div>
                                <div class="layui-inline">
                                    <div class="layui-input-inline">
                                        <input class="layui-input" type="text" name="createStart"
                                               value="${input.createStart}" placeholder="开始日">
                                    </div>
                                    -
                                    <div class="layui-input-inline">
                                        <input class="layui-input" type="text" name="createEnd"
                                               value="${input.createEnd}" placeholder="截止日">
                                    </div>
                                </div>
                            </li>
                            <li class="form-item-inline">
                                <div class="sub-btns">
                                    <a class="layui-btn layui-btn-danger"
                                       href="javascript:submitFunctionNew('#myForm')">查询</a>
                                    <a class="layui-btn layui-btn-normal"
                                       href="javascript:resetFunction('#myForm')">重置</a>
                                </div>
                            </li>
                        </ul>
                    </div>
                </div>
            </form>
            <div class="list-content">
                <ul class="num mt10">
                    <div class="l">
                        <li class="f16">共<span class="red">${page.totalCount}</span>条数据</li>
                    </div>
                    <p class="cl"></p>
                </ul>
                <div class="cl">
                    <table class="layui-table">
                        <colgroup>
                            <col width="100px">
                            <col width="150px">
                            <col>
                            <col width="20%">
                            <col width="100px">
                            <col width="200px">
                            <col width="110px">
                            <col width="100px">
                        </colgroup>
                        <thead>
                        <tr>
                            <th>排序号</th>
                            <th>合作商</th>
                            <th>项目名称</th>
                            <th>众筹者/支持者</th>
                            <th>类型</th>
                            <th>提交时间</th>
                            <th>是否已执行</th>
                            <th>详情</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach var="refundPlan" items="${refundPlanList}" varStatus="st">
                            <tr>
                                <td>
                                    <c:set var="rowNo" value="${st.count + ((page.page - 1) * page.limit)}"/>
                                    <c:if test="${rowNo < 10}">0${rowNo}</c:if>
                                    <c:if test="${rowNo >= 10}">${rowNo}</c:if>
                                </td>
                                <td class="table-member">${refundPlan.partners}</td>
                                <td>${refundPlan.name}</td>
                                <td>
                                    <a href="${ctx}/crowdfund/support/listForProjectId.do?id=${refundPlan.activityId}&projectId=${refundPlan.projectId}&source=1">
                                        ${refundPlan.userName}
                                    </a>
                                </td>
                                <td>${refundPlan.type}</td>
                                <td><fmt:formatDate value="${refundPlan.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                                <td>
                                    <c:if test="${refundPlan.result == 1}">YES</c:if>
                                    <c:if test="${refundPlan.result == 0}">NO</c:if>
                                </td>
                                <td><a href="javascript:openDialogShow('退款详情','${ctx}/refund/refundPlan.do?goalId=${refundPlan.goalId}','700px','500px')">
                                    退款详情
                                </a></td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
            </div>
            <div id="page_content" class="page-container"></div>
        </div><!--底部-->
        <%@include file="../include/footer.jsp" %>
    </section>
</div>
<script type="text/javascript" src="${ctx}/script/common/list.js"></script>
<script type="text/javascript" src="${ctx}/script/common/table_option.js"></script>
<script type="text/javascript">
    txz.initHeader({
        nav: [{
            name: '退款计划列表',
            curr: true
        }],
        info: '<span class="f12">共<b>${page.totalCount}</b>条记录',
        btns: []
    });
    //加载分页
    loadPageNew({elem: 'page_content', totalCount: '${page.totalCount}', limit: '${page.limit}', page: '${page.page}'});

    $(function () {
        //加载日历
        layui.use(['laytpl', 'laypage', 'element', 'laydate'], function () {
            var laytpl = layui.laytpl, laydate = layui.laydate, laypage = layui.laypage, element = layui.element;
            element.on('tab(type)', function (data) {
                if (data.index == 0) {
                    $('#status').val(0);
                    $('#myForm').submit();
                }
                else if (data.index == 1) {
                    $('#status').val(1);
                    $('#myForm').submit();
                }
            });

            // 查询开始日期
            var start = {
                elem: 'input[name=s_start]'
            };

            var end = {
                elem: 'input[name=s_end]'
            };
            laydate.render(start);
            laydate.render(end);

            // 查询发布日期
            var start = {
                elem: 'input[name=createStart]'
            };

            var end = {
                elem: 'input[name=createEnd]'
            };
            laydate.render(start);
            laydate.render(end);
        });
    })

</script>
</body>
</html>